package csel.view.status;

import java.awt.Dimension;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

import csel.controller.bindings.StringActionCommands;

public class SystemMenu extends JPanel{

	private static final long serialVersionUID = 1L;
	
	private ActionListener myListener;
	
	public static SystemMenu initialize(ActionListener myListener)
	{
		SystemMenu myMenu = new SystemMenu(myListener);
		myMenu.makeAndAddButtons();
		return myMenu;
	}
	
	private SystemMenu(ActionListener myListener)
	{
		this.myListener = myListener;
	}
	
	public void makeAndAddButtons()
	{
		JButton newButton = new JButton("New Game");
		newButton.setActionCommand(StringActionCommands.BM_SYSTEM_NEW);
		newButton.setFocusable(false);
		newButton.addActionListener(myListener);
		
		JButton loadButton = new JButton("Load Game");
		loadButton.setActionCommand(StringActionCommands.BM_SYSTEM_LOAD);
		loadButton.setFocusable(false);
		loadButton.addActionListener(myListener);
		
		JButton saveButton = new JButton("Save Game");
		saveButton.setActionCommand(StringActionCommands.BM_SYSTEM_SAVE);
		saveButton.setFocusable(false);
		saveButton.addActionListener(myListener);
		
		JButton quitButton = new JButton("Quit Game");
		quitButton.setActionCommand(StringActionCommands.BM_SYSTEM_QUIT);
		quitButton.setFocusable(false);
		quitButton.addActionListener(myListener);
		
		JButton controlsButton = new JButton("Change Controls");
		controlsButton.setActionCommand(StringActionCommands.BM_SYSTEM_CONTROLS);
		controlsButton.setFocusable(false);
		controlsButton.addActionListener(myListener);
		
		add(newButton);
		add(loadButton);
		add(saveButton);
		add(quitButton);
		add(controlsButton);
		
		setPreferredSize(new Dimension(375,125));
		setOpaque(false);
	}
}
